package com.ruoyi.flow.web;

import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.util.ObjectUtils;

/**
 * @title: 基础resource
 * @author: bruce.liu
 * @since: 2023/9/27 13:22
 */
public abstract class BaseResource  {

    public LoginUser getLoginUserInfo() {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        if(ObjectUtils.isEmpty(loginUser)){
            throw new RuntimeException("获取登录信息失败，请重新登录！");
        }
        return loginUser;
    }
}
